//
//  AllSubSortVC.m
//  reSearchDemo
//
//  Created by 云库 on 15/9/25.
//  Copyright (c) 2015年 Kiwaro. All rights reserved.
//

#import "AllSubSortVC.h"
#import "UIView+Category.h"
#import "GoodsClassInfo.h"
#import "BrandList.h"

@interface AllSubSortVC ()<UITableViewDelegate,UITableViewDataSource>

@property (strong, nonatomic) UITableView *tableView;

/** 商标数组*/
@end

@implementation AllSubSortVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupTableView];
}

/**
 * 创建tableView
 */
- (void)setupTableView{
    
    //2.创建table view
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height) style:UITableViewStylePlain];
    self.tableView.delegate = self;
    self.tableView.dataSource =self;
    self.tableView.showsHorizontalScrollIndicator = NO;
    self.tableView.showsVerticalScrollIndicator = NO;
    self.tableView.tableFooterView = [[UIView alloc] init];
    self.tableView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:self.tableView];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    DLog(@"/////---%lu",(unsigned long)self.brandArr.count);
    return self.brandArr.count;
    
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
    if(cell == nil){
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
    }
    BrandList *brank = self.brandArr[indexPath.row];
    cell.textLabel.text = brank.name;
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    DLog(@"点击了cell");
    BrandList *brand = self.brandArr[indexPath.row];
    DLog(@"----===---%@",brand.name);
}



@end
